package com.zhang.crawler.controller;

import com.zhang.crawler.utils.ResultVO;
import com.zhang.crawler.utils.StatusCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : zhang sq
 * @date : 2020/7/31 14:41
 **/
@Api(tags = "vue学习测试",description = "TestController")
@RequestMapping("/test")
@RestController
public class TestController {

    @Autowired
    private TestRepository testRepository;

    @ApiOperation("test")
    @GetMapping("/test")
    public ResultVO select(){
        List<Product> productList= testRepository.findAll();
        return new ResultVO(StatusCode.RESULT_SUCCESS,productList);
    }
}
